package cn.chenhuanming.shh.administer.entity.jpa;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * EstateBroker entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "estate_broker", catalog = "house")
public class EstateBroker implements java.io.Serializable {

	// Fields

	private Integer id;
	private Estate estate;
	private UserBroker userBroker;
//	private String brokerName;
//	private String estateName;
//	private String estatePhoto;
//	private String estateLocation;

	// Constructors

	/** default constructor */
	public EstateBroker() {
	}

	/** minimal constructor */
	public EstateBroker(Estate estate, UserBroker userBroker) {
		this.estate = estate;
		this.userBroker = userBroker;
	}

	/** full constructor */
	public EstateBroker(Estate estate, UserBroker userBroker,
			String brokerName, String estateName, String estatePhoto,
			String estateLocation) {
		this.estate = estate;
		this.userBroker = userBroker;
//		this.brokerName = brokerName;
//		this.estateName = estateName;
//		this.estatePhoto = estatePhoto;
//		this.estateLocation = estateLocation;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "estate_id", nullable = false)
	public Estate getEstate() {
		return this.estate;
	}

	public void setEstate(Estate estate) {
		this.estate = estate;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "broker_id", nullable = false)
	public UserBroker getUserBroker() {
		return this.userBroker;
	}

	public void setUserBroker(UserBroker userBroker) {
		this.userBroker = userBroker;
	}

//	@Column(name = "broker_name")
//	public String getBrokerName() {
//		return this.brokerName;
//	}
//
//	public void setBrokerName(String brokerName) {
//		this.brokerName = brokerName;
//	}
//
//	@Column(name = "estate_name")
//	public String getEstateName() {
//		return this.estateName;
//	}
//
//	public void setEstateName(String estateName) {
//		this.estateName = estateName;
//	}
//
//	@Column(name = "estate_photo")
//	public String getEstatePhoto() {
//		return this.estatePhoto;
//	}
//
//	public void setEstatePhoto(String estatePhoto) {
//		this.estatePhoto = estatePhoto;
//	}
//
//	@Column(name = "estate_location")
//	public String getEstateLocation() {
//		return this.estateLocation;
//	}
//
//	public void setEstateLocation(String estateLocation) {
//		this.estateLocation = estateLocation;
//	}

}